home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The X-Philes (2nd Revision)
/
The X-Philes Number 1 (1995).iso
/
xphiles
/
hp95
/
gnuchess.arc
/
hp95.h
< prev
next >
Wrap
Text File
|
1992-01-16
|
7KB
|
187 lines
/************************************************************************
* Definitions. *
************************************************************************/
/**********************************************************************/
/* Normal text size. */
/**********************************************************************/
# define FONT_WIDTH 6
# define FONT_HEIGHT 8
# define MAX_X 239
# define MAX_Y 127
#define G_ALPHA_SM 0x07
#define G_ALPHA 0x87
#define G_GRAPHICS_SM 0x20
#define G_GRAPHICS 0xa0
#define G_FORCE 0
#define G_AND 1
#define G_OR 2
#define G_XOR 3
#define G_NOTFORCE 4
#define G_NOTAND 5
#define G_NOTOR 6
#define G_NOTXOR 7
#define G_OUTLINE 0
#define G_SOLIDFILL 1
#define G_PATTERNFILL 2
#define MINCOLOR 0
#define MAXCOLOR 1
/************************************************************************
* Structures. *
************************************************************************/
typedef struct g_info {
unsigned char vidmode;
unsigned char defmode;
unsigned int xpixels;
unsigned int ypixels;
int xloc;
int yloc;
unsigned int linetype;
int rrule;
unsigned int color;
int xclipmin;
int yclipmin;
int xclipmax;
int yclipmax;
int xlorg;
int ylorg;
unsigned char fillmask[8];
} G_INFO;
/**********************************************************************/
/* Structure used for READ AREA and WRITE AREA */
/**********************************************************************/
typedef struct g_area {
short planes; /* always 1 */
short bits_per_pixel; /* always 1 */
short width;
short height;
} G_AREA;
/************************************************************************
* Graphics library function definitions. All x,y locations are rel- *
* ative to the current logical origin unless specified otherwise. *
************************************************************************/
void far cdecl G_Mode(int);
G_INFO far * cdecl G_GetInfo(G_INFO far *);
void far cdecl G_ColorSel(int);
void far cdecl G_RepRule(unsigned int);
void far cdecl G_LineType(unsigned int);
void far cdecl G_FillMask(unsigned char far *);
void far cdecl G_LorgA(int, int);
void far cdecl G_ClipL(int, int, int, int);
void far cdecl G_Move(int, int);
void far cdecl G_Point(int, int);
int far cdecl G_PointRead(int, int);
void far cdecl G_Draw(int, int);
void far cdecl G_Rect(int, int, int);
void far cdecl G_ImageGet(int, int, int, int, char far *);
void far cdecl G_ImagePut(int, int, char far *, int);
void far cdecl G_Text(int, int, char far *, int);
void draw_small_string(int, int, char far *);
/*************************************************************************/
/**** G_MODE(mode): mode = {G_TEXT | G_GRAPHICS}
changes the display mode to text or graphics */
/**** G_GETINFO(GraphInfoPtr): GraphInfoPtr is a far pointer to a buffer of
the programmers choosing where the graphics information will be copied.
See the typedef for the G_INFO structure in this file for the contents
of the buffer. */
/*************************************************************************/
/**** G_COLORSEL(color): color = 0 or 1
sets the current pen to "color" */
/**** G_REPRULE(reprule): reprule = {G_FORCE | G_AND | G_OR | G_XOR}
sets the current replacement rule for all other drawing (except for
G_ImagePut, which specifies its own replacement rule). */
/**** G_LINETYPE(linetype): linetype = a 16-bit image that is repeated while
drawing lines and G_OUTLINE'd rectangles. Bits that are 1 cause the
current pen color to be plotted using the current replacement rule.
Bits that are 0 are not plotted and leave the display un-modified. */
/**** G_FILLMASK(buffer): buffer is a far pointer to an 8-byte array which
specifies the fillmask to use when doing drawings of rectangles
with a fillflag of G_PATTERNFILL. Every bit that is a 1 will
cause a point of the current color to be plotted. Every bit that is
a 0 will cause that "point" of the display to be undisturbed. */
/*************************************************************************/
/**** G_LORGA(x,y): x,y = -32768 to +32767
sets the logical origin (0,0) to be located at the absolute screen
coordinate specified by x,y. */
/**** G_CLIPL(x1, y1, x2, y2): x1,y1,x2,y2 = -32768 to +32767
sets the current clip boundary to the rectangle whose diagonally
opposite corners are specified by the absolute screen coordinates
equal to the x1,y1 and x2,y2 offsets from the current logical origin.*/
/*************************************************************************/
/**** G_MOVE(x, y): x,y = -32768 to +32767
causes the logical pen to be moved to "x,y" */
/**** G_POINT(x,y): x,y = -32768 to +32767
plots a point of the current pen color with the current replacement
rule at "x,y" unless "x,y" is outside the current clip limits */
/**** G_POINTREAD(x,y): x,y = -32768 to +32767
reads the color of the point located at x,y and returns that as the
value of the function. */
/**** G_DRAW(x,y): x,y = -32768 to +32767
draws a line of the current pen color with the current replacement rule
and the current linetype from the current pen location to "x,y";
only those points lying within the clip limits are actually plotted. */
/**** G_RECT(x,y,fillflag): x,y = -32768 to +32767
fillflag = {G_OUTLINE | G_SOLIDFILL | G_PATTERNFILL}
draws a rectangle with diagonally opposite corners at the current pen
location and at "x,y", using the current pen color and replacement
rule. The "type" of rectangle drawn is determined by fillflag.
if fillflag==G_OUTLINE, the outline of a rectangle is drawn, using the
current linetype.
if fillflag==G_SOLIDFILL, a solid, filled rectangle of the current
color is drawn.
if fillflag==G_PATTERNFILL, a pattern filled rectangle of the current
color is drawn, using the current fill mask. */
/*************************************************************************/
/**** G_IMAGEGET(x1, y1, x2, y2, buffer): x1,y1,x2,y2 = -32768 to +32767
If both points x1,y1 and x2,y2 are within the current clip boundary,
the display image bounded by the rectangle whose diagonally opposite
corners are x1,y1 and x2,y2 is read into the bytes pointed to by
"buffer".
NOTE: for G_ImageGet(), the required size of 'buffer' is (on Jaguar):
8 + ((x2-x1+8)/8) * (y2-y1+1) bytes */
/**** G_IMAGEPUT(x, y, buffer, reprule): x,y = -32768 to +32767
reprule = {G_FORCE | G_AND | G_OR | G_XOR | G_NOTFORCE | G_NOTAND |
G_NOTOR | G_NOTXOR}
if x,y and the un-specified bottom-right corner of the image are
within the clip boundary, the image from "buffer" is drawn on the
display using reprule as the replacement rule. (For the "NOT" replace-
ment rules, the image is color-inverted first, then placed on the
display using the "rest" of the replacement rule.) */
/*************************************************************************/
/**** G_TEXT(x,y,buffer,rotflag): x,y = -32768 to +32767, rotflag = 0 or 1
draws the string pointed to by "buffer" on the display at the specified
location x,y using the current font. If rotflag = 0, it's drawn
horizontally, else it's rotated 90 degrees counterclockwise. */
/*************************************************************************/